import 'package:flutter_app/interface/mvp.dart';

/// Worm 页面模型
class WormModel implements IModel {
  /// 刷新
  static const String REFRESH = 'refresh';

  /// 加载更多
  static const String LOADMORE = 'loadmore';

  /// 获取图虫 API
  String getWormApi() {
    return 'https://api.tuchong.com/feed-app';
  }

  /// 获取图虫请求参数
  /// @param page 页面
  /// @param type 类型
  /// @return 返回 Get 请求参数
  Map<String, dynamic> getWormParams(int page, String type) {
    // 参数
    Map<String, dynamic> params = Map<String, dynamic>();
    params['os_api'] = 22;
    params['device_type'] = 'MI';
    params['device_platform'] = 'android';
    params['ssmix'] = 'a';
    params['manifest_version_code'] = 232;
    params['dpi'] = 400;
    params['abflag'] = 0;
    params['uuid'] = 651384659521356;
    params['version_code'] = 232;
    params['app_name'] = 'tuchong';
    params['version_name'] = '2.3.2';
    params['openudid'] = '65143269dafd1f3a5';
    params['resolution'] = '1280*1000';
    params['os_version'] = '5.8.1';
    params['ac'] = 'wifi';
    params['aid'] = 0;
    params['page'] = page;
    params['type'] = type;
    return params;
  }

  /// 获取图片地址
  /// @param userId 用户ID
  /// @param imgId 图片 ID
  String getImageApi(int userId, int imgId) =>
      'https://photo.tuchong.com/$userId/f/$imgId.jpg';
}
